import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/components/layout'
Vue.use(Router)
export const constantRoutes = [
    {
        path:'/',
        name: 'layout',
        component: Layout,
        redirect:'/camera-manager',
        children: [{
            path:'/camera-manager',
            name: 'camera-manager',
            component: ()=> import("@/view/camera-manager/index.vue")
        },{
            path:'/camera-stream',
            name: 'camera-stream',
            component: ()=> import("@/view/camera-stream/index.vue")
        }]
    },

]

const createRouter = () => new Router({
    // mode: 'history',
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
})

const router = createRouter()


export default router
